<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0" prefix="dsp" %>
<dsp:page>
		<dsp:importbean bean="/atg/commerce/catalog/ProductLookup"/>
		<dsp:importbean bean="/atg/userprofiling/ProfileFormHandler" />
		<dsp:importbean bean="/atg/dynamo/droplet/Switch" />
		<dsp:importbean bean="/atg/dynamo/droplet/ErrorMessageForEach" />
		<dsp:importbean bean="/atg/commerce/catalog/CategoryLookup" />
		<dsp:importbean bean="/atg/dynamo/droplet/ForEach" />
		<dsp:importbean bean="/atg/commerce/pricing/PriceEachItem" />
		<dsp:importbean bean="/atg/commerce/pricing/ItemPriceInfo"/>
		<dsp:importbean bean="/atg/commerce/order/ShoppingCartModifier"/>
		<dsp:importbean bean="/atg/commerce/payment/CreditCardTools"/>
		<dsp:importbean bean="/atg/commerce/order/purchase/CommitOrderFormHandler"/>
		<dsp:importbean bean="/atg/commerce/order/OrderLookup"/>
		<dsp:importbean bean="/atg/userprofiling/Profile"/>
		<dsp:importbean bean="/atg/commerce/order/Order/TaxPriceInfo"/>
		
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@include file="style.jspf" %>
<title>Course</title>
</head>	
<body>


<div id="wrap" class="clear-block">
    <div id="header"><jsp:include page="header.jsp"/></div>
    <h3>Order Detail</h3>
    <div class="orderHsy">
    	<div class="unitOrder">
        	<p><span class="blod">Order# :</span>
				<dsp:valueof param="orderno"/>
			
			</p>
            <p><span class="blod">Order Date :</span>
				<dsp:valueof param="orderdate" date="mm/dd/yyyy"/>
			</p>
            <p><span class="blod">Status :</span>
				<dsp:valueof param="orderstate"/>
			</p>
        </div>
										
			<div class="listBox">
				<ul class="head">
					<li class="item">Item</li>
					<li class="qty">Quantity</li>
					<li class="price">Amount</li>
				</ul>
			</div>

			<dsp:droplet name="OrderLookup"> 
				<dsp:param name="orderId" param="orderID"/>
				<dsp:oparam name="output">
	
					<dsp:droplet name="ForEach">
                    	<dsp:param name="array" param="result.commerceItems"/>
                    	<dsp:setvalue param="commerceItem" paramvalue="element"/>
                    	<dsp:oparam name="outStart">
						</dsp:oparam>  
						<dsp:oparam name="output">
							<div class="listBox">
							<ul>
								<li class="item">
								 <p class="name">
									<dsp:valueof param="commerceItem.auxiliaryData.productRef.displayName"></dsp:valueof>
								 </p>
								 <p>SKU: <span><dsp:valueof param="commerceItem.catalogRefId"/></span></p>
								</li>
								<li class="qty">
								  <dsp:valueof param="commerceItem.quantity"/> 
								</li>     
								<li class="price">
									<dsp:valueof param="commerceItem.priceinfo.amount" converter="currency"/>

								</li>
							</ul>
							</div>
                    	</dsp:oparam>
					</dsp:droplet> 
				
					<div class="totalBox">				
						<table>
							<tr>
								<td width="92%" class="subTotal">Sub Total:				
								</td>  
								<td width="92%" class="subTotal">
								    <dsp:getvalueof param="result.priceInfo.rawSubtotal" var="subtotal" />
									<dsp:valueof param="result.priceInfo.rawSubtotal" converter="currency"></dsp:valueof>
								</td>  
							</tr>	
							<tr>
								<td class="subTotal">Tax</td>
								<td>
									<dsp:getvalueof var="tax" param="result.taxPriceInfo.amount"/>
									<dsp:valueof param="result.taxPriceInfo.amount" converter="currency" />
								</td>
							</tr>
							<tr>
							    <td class="subTotal">Shipping</td>
								<td>
								<dsp:getvalueof var="country" param="result.shippingGroups[0].shippingAddress.country"/>
								<dsp:valueof param="country"/>
								<c:choose>
			                 	<c:when test ='${country == "US"}' >
									<p><dsp:setvalue param="shippingcost" value="0.00"/></p>
									
			                 	 </c:when>
			                 	 <c:otherwise>
									<p><dsp:setvalue param="shippingcost" value="0.00"/></p>    	 
			                 	</c:otherwise>
		                 	 </c:choose>
							    <dsp:valueof param="shippingcost" converter="currency"/>
								<dsp:getvalueof var="shipcost" param="shippingcost"/>
							    </td>
							</tr>
						
							<tr>
								<td class="total">Total</td>
								<td class="total"><c:out value="${tax + shipcost + subtotal}"/></td>
							</tr>
						</table>
						<div class="shipping">
							<h4>Ship To</h4>
<!-- 						<div class="info">
								<p class="name">
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.firstName"/>&nbsp;
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.lastName"/>
								</p>
								<p>
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.address1"/>&nbsp;
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.address2"/>
								</p>
								<p>
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.city"/>&nbsp;
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.state"/>&nbsp;
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.postalCode"/>
								</p>
								<p>
									<dsp:valueof param="result.shippingGroups[0].shippingAddress.country"/>&nbsp;
								</p>
				
							</div>
 -->							
						</div>
        
						<div class="paymentInfo">
							<h4>Payment Information</h4>
							<div class="info">
								<p class="name">                        
									<dsp:valueof param="result.paymentGroups[0].billingAddress.firstName"/>&nbsp;
									<dsp:valueof param="result.paymentGroups[0].billingAddress.lastName"/>
								</p>
								<p>
									<dsp:getvalueof var="cardType" param="result.paymentGroups[0].creditCardType" vartype="java.lang.String">
										<dsp:getvalueof bean="/atg/commerce/payment/CreditCardTools.cardTypesMap" var="cts">
											<dsp:valueof value="${cts[cardType]}"/>&nbsp;
										</dsp:getvalueof>
									</dsp:getvalueof>
								 <dsp:valueof param="result.paymentGroups[0].creditCardNumber" converter="CreditCard" maskcharacter="*" numcharsunmasked="4"/>
								</p>
								<p>
								  <dsp:valueof param="result.paymentGroups[0].billingAddress.address1"/>
								</p>
								<p>
								   <dsp:valueof param="result.paymentGroups[0].billingAddress.city"/>&nbsp;,
								   <dsp:valueof param="result.paymentGroups[0].billingAddress.state"/>&nbsp;
								   <dsp:valueof param="result.paymentGroups[0].billingAddress.postalCode"/>
								</p>
								<p>
								  <dsp:valueof param="result.paymentGroups[0].billingAddress.country"/>
								</p>

							</div>
						</div>
					</div>
				</dsp:oparam>
			</dsp:droplet>  	

	
    </div>
    <div id="footer"><jsp:include page="footer.jsp"/></div>
</div>
</body>
</dsp:page>
</html>